int countSegments(char * s)
{   int count=0;
int i=0;
    if(strlen(s)==0)
    return 0;
    else
    while(s[i]!='\0')
    {
        if((s[i]!=' '&&s[i+1]==' ')||(s[i]!=' '&&s[i+1]=='\0'))
        count++;
        i++;
    }
    return count;
}